package com.g1.gzbooksingle.controller;


import com.g1.gzbooksingle.model.DgPayRecord;
import com.g1.gzbooksingle.model.DgPublishInfo;
import com.g1.gzbooksingle.service.IDgPublishInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 出版社表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2021-10-12
 */
@Slf4j
@Api(tags = "出版社信息接口")
@RestController
@RequestMapping("/gzbooksingle/dgPublishInfo")
public class DgPublishInfoController {

    @Autowired
    private IDgPublishInfoService iDgPublishInfoService;

    /**
     * 查询全部出版社信息
     * @return
     */
    @GetMapping
    @ApiOperation("查询全部出版社信息")
    public List<DgPublishInfo> getList(){
        List<DgPublishInfo> list = iDgPublishInfoService.list();
        return list;
    }

    /**
     * 根据出版社id查询出版社信息
     * @return
     */
    @GetMapping("/{id}")
    @ApiOperation("根据出版社id查询出版社信息")
    public DgPublishInfo getById(@ApiParam(value = "出版社id") @PathVariable Integer id){
        DgPublishInfo dgPublishInfo = iDgPublishInfoService.getById(id);
        return dgPublishInfo;
    }

}
